<!DOCTYPE >
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>角色列表</title>


<link rel="stylesheet" type="text/css" href="/system/css/right.css">
<script type="text/javascript" src="/system/js/jquery.js"></script>
<script type="text/javascript" src="/system/js/system.js"></script>
<script type="text/javascript" src="/system/js/admin.js"></script>
</head>
<style media="screen">
	.table td>input{
			width:auto;
			margin-right: 10rpx!important;
	}
	.child{
		float: left;
		margin-left: 10px;
	}
	.table td{
		text-align: left;
	}
	.cenr{
		/* margin-top:0; */
		margin: 0 auto;
		display: block;
	}
</style>
<body style="overflow: auto;">
	<div class="basic bor">
			<div class="title fl">当前位置：系统管理 > 角色列表</div>
	</div>

	<!-- <form action="{:url('news/addcate')}" method="post"> -->
	<div class="addnav">
			<!-- <a class="submit fr addnews" href="{:url('Homerole/add_role')}"   />添加角色</a> -->
	</div>
	<!-- </form> -->
<!-- 文章分类列表 -->
<div class="catelist">
    <div class="lists listsov">
    <dd>角色列表</dd>
    </div>
</div>
<!-- /文章分类列表 -->
<form action="{:url('Homerole/add_role')}" method="post">
<table border="1"  class="table table-hover text-center" id='list'>
  <tr class="trcolor">
    <td>&nbsp;&nbsp;选择</td>
   	<td>&nbsp;&nbsp;角色名称</td>
  </tr>
<!-- ============================================================= -->
{volist name="list" id="li"}
  <tr>
    <td>&nbsp;&nbsp;
			<input class="checkbox bor" all_id="{$li.id}"  {$li.val} onclick="alls({$li.id})" name="all[]" type="checkbox" value="{$li.id}" />
			{$li.name}
		</td>
		<td>
			{volist name="li.child" id="vo"}
			<div class="child"><input class="checkbox bor"  checked_id="{$li.id}"  type="checkbox"  name="all[]" {$vo.val} value="{$vo.id}"/>&nbsp;{$vo.name}</div>
			{/volist}
		</td>
  </tr>
{/volist}
<!-- ============================================================= -->
</table>
<script type="text/javascript">
	function alls(id){
		var flag = $('[all_id='+id+']').is(":checked");
			if (flag) {
					$('[checked_id='+id+']').prop("checked",true);
			}else{
						$('[checked_id='+id+']').prop("checked",false);
			}

		// var clicks = document.querySelectorAll("#allid"+id+""),
		// 	len = clicks.length;



	}
</script>


<div class="pages">
	<input type="hidden" name="id" value="{$id}" >
			<input type="submit" class="submit cenr" value="修改">
</div>
</form>
</body>
</html>
